package com.cooper.service.admin;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cooper.dao.brand.BrandDAO;
import com.cooper.entity.BrandBaseEntity;

@Service
public class BrandManageService {

	protected Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@Autowired
	BrandDAO  brandDao;
	
	public List<BrandBaseEntity> findBrandList(BrandBaseEntity brandBaseDo){
		List<BrandBaseEntity> ret = null;
		try {
			ret =  brandDao.queryBrandList(brandBaseDo);
		} catch (Exception e) {
			logger.error("BrandManageService-findBrandList-error", e);
		}
		return ret;
	}
	
	public void addBrand(BrandBaseEntity brandBaseDo){
		try {
			brandDao.addBrandBase(brandBaseDo);
		} catch (Exception e) {
			logger.error("BrandManageService-addBrand-error", e);
		}
	}
	
	public BrandBaseEntity  findBrandById(Long id){
		BrandBaseEntity bdo = null;
		try {
			bdo = brandDao.findBrandBaseById(id);
		} catch (Exception e) {
			logger.error("BrandManageService-addBrand-error", e);
		}
		return bdo;
	}
	
	public void deleteBrand(BrandBaseEntity brandBaseDo){
		try {
			brandDao.deleteScheduler(brandBaseDo);
		} catch (Exception e) {
			logger.error("BrandManageService-deleteBrand-error", e);
		}
	}
	
	
}
